package com.mitaotao._1_语法._3_分支._3_if判断;

import java.util.Scanner;

public class _08_按位输出_A顺序 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入一个不多于五位的整数：");
        int num,W,Q,B,S,G;
        num = scanner.nextInt();
        W = 0;
        Q = 0;
        B = 0;
        S = 0;
        G = 0;

        if (num>10000){
            W = num/10000;
            Q = num/1000 % 10;
            B = num/100 % 10;
            S = num/10 % 10;
            G = num % 10;
            System.out.println("万："+W+"，千："+Q+"，百："+B+"，十："+S+"，个："+G);
        } else if (num>1000) {
            Q = num/1000 % 10;
            B = num/100 % 10;
            S = num/10 % 10;
            G = num % 10;
            System.out.println("千："+Q+"，百："+B+"，十："+S+"，个："+G);
        } else if (num>100) {
            B = num/100 % 10;
            S = num/10 % 10;
            G = num % 10;
            System.out.println("百："+B+"，十："+S+"，个："+G);
        } else if (num>10) {
            S = num/10 % 10;
            G = num % 10;
            System.out.println("十："+S+"，个："+G);
        }else {
            G = num % 10;
            System.out.println("您输入的是一个个位数，个："+G);
        }
        scanner.close();
    }
}
